<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="cong.jdbc.JdbcConn"%>
<%@page import="com.dy.nygl.pojo.EnergyYear"%>
<%@page import="com.dy.nygl.pojo.Energy"%>
<%@page import="java.text.DecimalFormat"%>
<%
	DecimalFormat df = new DecimalFormat("0.0");
	
	List<EnergyYear> yearlist = new JdbcConn().getYearList();
	String cat1 = yearlist.get(0).getName();
	String cat2 = yearlist.get(1).getName();
	String cat3 = yearlist.get(2).getName();
	String cat4 = yearlist.get(3).getName();
	String cat5 = yearlist.get(4).getName();
	String cat6 = yearlist.get(5).getName();

	double sum1 = Double.parseDouble(yearlist.get(6).getJan());
	double sum2 = Double.parseDouble(yearlist.get(6).getFeb());
	double sum3 = Double.parseDouble(yearlist.get(6).getMar());
	double sum4 = Double.parseDouble(yearlist.get(6).getApr());
	double sum5 = Double.parseDouble(yearlist.get(6).getMay());
	double sum6 = Double.parseDouble(yearlist.get(6).getJun());
	double sum7 = Double.parseDouble(yearlist.get(6).getJuly());
	double sum8 = Double.parseDouble(yearlist.get(6).getAug());
	double sum9 = Double.parseDouble(yearlist.get(6).getSep());
	double sum10 = Double.parseDouble(yearlist.get(6).getOct());
	double sum11 = Double.parseDouble(yearlist.get(6).getNov());
	double sum12 = Double.parseDouble(yearlist.get(6).getDec1());

	double pre1 = Double.parseDouble(yearlist.get(7).getJan());
	double pre2 = Double.parseDouble(yearlist.get(7).getFeb());
	double pre3 = Double.parseDouble(yearlist.get(7).getMar());
	double pre4 = Double.parseDouble(yearlist.get(7).getApr());
	double pre5 = Double.parseDouble(yearlist.get(7).getMay());
	double pre6 = Double.parseDouble(yearlist.get(7).getJun());
	double pre7 = Double.parseDouble(yearlist.get(7).getJuly());
	double pre8 = Double.parseDouble(yearlist.get(7).getAug());
	double pre9 = Double.parseDouble(yearlist.get(7).getSep());
	double pre10 = Double.parseDouble(yearlist.get(7).getOct());
	double pre11 = Double.parseDouble(yearlist.get(7).getNov());
	double pre12 = Double.parseDouble(yearlist.get(7).getDec1());

	
	double sumyear = Double.parseDouble(yearlist.get(6).getYear());
	int sumyear1=Integer.parseInt(yearlist.get(6).getYear());
	double preyear = Double.parseDouble(yearlist.get(7).getYear());

	double saveyear = preyear - sumyear;

	double percent = sumyear / preyear * 100;
	String percent1=df.format(percent);

	double percentless = saveyear / preyear * 100;
	String percentless1=df.format(percentless);

	String score = "";

	if (percent >= 100) {
		score = "0";
	} else if (percent >= 90 & percent < 100) {
		score = "60";
	} else if (percent >= 80 & percent < 90) {
		score = "70";
	} else if (percent >= 70 & percent < 80) {
		score = "80";
	} else if (percent >= 60 & percent < 70) {
		score = "90";
	} else if (percent < 60) {
		score = "Very Good!";
	}
%>
